/*
 * MS5541.h
 *
 * Created: 10.01.2014 17:00:02
 *  Author: Hf
 */ 


#ifndef MS5541_H_
#define MS5541_H_

#include "asf.h"

typedef struct {
	uint16_t SENST1;
	uint16_t OFFT1;
	uint16_t TCS;
	uint16_t TCO;
	uint16_t Tref;
	uint16_t TEMPSENS;
} coeff_t;

void send_bytes(uint16_t data);
uint16_t get_bytes(void);
void get_coeffs(coeff_t* coefficients);
uint16_t read_temp(void);
int16_t get_temp_diff(coeff_t* coeffs);
int16_t get_temperature(int16_t dT, coeff_t* coeffs);
uint16_t get_pressure(int16_t dT, coeff_t* coeffs);
void init_SPI_MS5541(void);
void init_Timer0_MS5541(void);
void init_MS5541(void);

#endif /* MS5541_H_ */